package org.wzl.todolisthelper.service.impl;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.wzl.todolisthelper.service.NormalTaskService;
import org.wzl.todolisthelper.service.PeriodicTaskService;
import org.wzl.todolisthelper.service.TaskService;
import org.wzl.todolisthelper.vo.IndexTaskCardVO;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@Service
public class TaskServiceImpl implements TaskService {

    @Resource
    private NormalTaskService normalTaskService;

    @Resource
    private PeriodicTaskService periodicTaskService;

    @Override
    public List<IndexTaskCardVO> getAllCard() {
        List<IndexTaskCardVO> all = new ArrayList<>();
        List<IndexTaskCardVO> normalTaskAll = normalTaskService.getAllCard();
        List<IndexTaskCardVO> periodicTaskCardVO = periodicTaskService.getAllCard();
        all.addAll(normalTaskAll);
        all.addAll(periodicTaskCardVO);
        return all;
    }

}
